/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.istia.gesstages.util;

import java.util.Date;
import java.util.GregorianCalendar;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

/**
 *
 * @author usrlocal
 */
public class DateFormat {

    public static XMLGregorianCalendar getGregorianDate(Date d) throws DatatypeConfigurationException {
        GregorianCalendar gCal = new GregorianCalendar();
        gCal.setTime(d);
        return DatatypeFactory.newInstance().newXMLGregorianCalendar(gCal);
    }
}
